package com.axsoft.jobimp.types;

/**
 * 
 * @author RankoR
 *
 * LongWord is 32-bit integer (int fact - int)
 */
public class LongWord extends DataType {

	private int mValue;
	
	public final int getValue() {
		return mValue;
	}
	
	public LongWord() {
		super(4);
		mValue = 0x00;
	}
	
	public LongWord(final byte[] pData) {
		super(4);
		
		if (pData.length != 4) {
			return; // TODO: Throw the exception!
		}

		mValue = (int) parseByteArray(pData);
		
		setData(pData);
	}
	
	public LongWord(final int pData) {
		super(4);
		setLongWord(pData);
	}
	
	public void setLongWord(final int pData) {
		mData[0] = (byte) (pData >>> 24);
		mData[1] = (byte) (pData >>> 16);
		mData[2] = (byte) (pData >>> 8);
		mData[3] = (byte) (pData);
		
		mValue = pData;
	}
	
}
